package algorithm.tree;

/**
 * 哈夫曼结点类
 */
public class HuffmanNode {
    int weight;
    int parent,left,right;
    public HuffmanNode(int weight){
        this.weight = weight; //权值
        this.parent = this.left = this.right = -1;
    }

    public HuffmanNode() {
        this(0);
    }

    @Override
    public String toString() {
        return "HuffmanNode{" +
                "weight=" + weight +
                ", parent=" + parent +
                ", left=" + left +
                ", right=" + right +
                '}';
    }
}
